<?php include "../public/header.php"?>
<?php include "../public/header_public.php"?>
<body class="laytp-container">
<div style="height: 45px"></div>
<div id="opt_nav">
</div>
<div id="dialog">
    <div class="page-title" id="page-title">
        <div class="page-title-con">
            <span class="title">选择工程信息</span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <button class="layui-btn layui-btn-sm btn-dark marginr5" type="button" id="submit">确定</button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
</div>


<div class="layui-card" id="search-form">
    <div class="layui-card-body">
        <form class="layui-form" id="TableSearchFormId" lay-filter="TableSearchForm" onkeydown="keyTableSearch('TableSearchForm', 'datalist')">
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <label class="layui-form-label">工程名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <label class="layui-form-label">工程编号</label>
                        <div class="layui-input-block">
                            <input type="text" name="number" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <label class="layui-form-label">甲方名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="jiaer" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">工程负责人</label>
                        <div class="layui-input-block">
                            <input type="text" name="gofuer" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">所在地</label>
                        <div class="layui-input-block">
                            <input type="text" name="areas" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">业务归属</label>
                        <div class="layui-input-block">
                            <input type="text" name="gui_unit" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">承揽方式</label>
                        <div class="layui-input-block">
                            <div id="lanshi" class="xmselect_div">
                                <div class="xmselect_title">请选择</div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">工程发布平台</label>
                        <div class="layui-input-block">
                            <div id="kailei" class="xmselect_div">
                                <div class="xmselect_title">请选择</div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">招标方式</label>
                        <div class="layui-input-block">
                            <div id="zhaotype" class="xmselect_div">
                                <div class="xmselect_title">请选择</div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">项目状态：</label>
                        <div class="layui-input-block">
                            <select id="state" name="state" lay-filter="state">
                                <option value="">请选择</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">所属单位</label>
                        <div class="layui-input-block">
                            <div id="chanid" class="xmselect_div">
                                <div class="xmselect_title">请选择</div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md3 search_hide none">
                        <label class="layui-form-label">审核状态：</label>
                        <div class="layui-input-block">
                            <select id="status" name="status" lay-filter="status">
                                <option value="">请选择</option>
                                <option value="1">流程（审批通过）</option>
                                <option value="0">流程（审批中）</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item search-div">
                            <div class="layui-form-item layui-inline">
                                <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="TableSearchButton" type="button"><i class="layui-icon layui-icon-search"></i>查询</button>
                                <button class="layui-btn layui-btn-primary" onclick="listTableReset()" id="TableSearchReset" type="reset" ><i class="layui-icon layui-icon-refresh"></i>重置</button>
                                <div id="search_open" onclick="toggle_search()">
                                    <i class="layui-icon layui-icon-down"></i>展开
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    // 单选多选分类 默认单选 choose_type传值为多选
    var choose_type = getQueryVariable('choose_type');
    if(choose_type === undefined || choose_type === false){
        choose_type = 'radio';
    }else{
        choose_type = 'checkbox';
    }

    // 用证专用
    var use_type = getQueryVariable('use_type');
    if(use_type === undefined || use_type === false){
        use_type = '';
    }
    var apply_type = getQueryVariable('apply_type');
    if(apply_type === undefined || apply_type === false){
        apply_type = '';
    }


    var parent_dom = getQueryVariable('dom');
    var parent_page = getQueryVariable('page');
    var parent_benenginid = getQueryVariable('benenginid') || 0;
    var parent_bengofuer = decodeURI(getQueryVariable('bengofuer') || '') || '';
    var parent_domkey = getQueryVariable('domkey');

    layui.use(['laytp','table','form','soulTable'], function () {
        var table = layui.table, form = layui.form, soulTable = layui.soulTable;

        $('#TableSearchReset').click(function () {
            $('.xmselect_div>xm-select').find('.xm-label-block').css('display','none');
            $('.xmselect_div').append('<div class="xmselect_title">请选择</div>');
            searchTableFunc(form, table)
        });

        $("#cols_table").hide();
        $("#export_table").hide();
        table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_opt_get_engin),where: {use_type: use_type, apply_type: apply_type,benenginid:parent_benenginid,bengofuer:parent_bengofuer}, page: true, height: 'full-140'
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: ['', '', ''],filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response,contextmenu:get_table_contextmenu(soulTable)
            ,parseData: function(res){
                var state_str = '<option value="">请选择</option>';
                var state = res.data.state;
                for (var key in state){
                    if(res.data.is_state == key){
                        state_str += '<option value="'+key+'" selected>'+state[key]+'</option>';
                    }else {
                        state_str += '<option value="'+key+'">'+state[key]+'</option>';
                    }

                }
                $("#state").html(state_str);

                xmselect_dan('chanid', res.data.chanid, res.data.is_chanid, function (res) {
                    setTimeout(function () {
                        searchTableFunc(form, table);
                    },100)
                })

                xmselect_dan('gui_unit', res.data.gui_unit, res.data.is_gui_unit, function (res) {
                    setTimeout(function () {
                        searchTableFunc(form, table);
                    },100)
                })

                xmselect_dan('lanshi', res.data.lanshi, res.data.is_lanshi, function (res) {
                    setTimeout(function () {
                        searchTableFunc(form, table);
                    },100)
                })

                xmselect_dan('kailei', res.data.kailei, res.data.is_kailei, function (res) {
                    setTimeout(function () {
                        searchTableFunc(form, table);
                    },100)
                })

                xmselect_dan('zhaotype', res.data.zhaotype, res.data.is_zhaotype, function (res) {
                    setTimeout(function () {
                        searchTableFunc(form, table);
                    },100)
                })


                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.data.total,
                    "data": res.data.data.data
                };
            }
            ,cols: [[
                {type:choose_type,fixed:'left'}
                ,{type:'numbers',title:'序号',fixed:'left'}
                ,{field: 'lantake_name', title: '承揽状态'}
                ,{field: 'state_name', title: '工程状态'}
                ,{field:'name',title:'工程名称',templet: function(d){
                        return '<span class="colorlan" onclick="openPage(\'../engin/show.php?id='+d.id+'\')">'+d.name+'</span>';
                    }}
                ,{field: 'number', title: '工程编号'}
                ,{field: 'jiaer', title: '甲方名称'}
                ,{field: 'gofuer', title: '工程负责人'}
                ,{field: 'gofutel', title: '工程负责人联系电话'}
                ,{field: 'areas', title: '所在地'}
                ,{field: 'addr', title: '详细地址'}
                ,{field: 'lanshi_name', title: '承揽方式'}
                ,{field: 'gui_unit_name', title: '业务归属'}
                ,{field: 'zhaotype_name', title: '招标方式'}
                ,{field: 'kailei_name', title: '工程发布平台'}
                ,{field: 'win_unit_name', title: '中标单位'}
                ,{field: 'windt', title: '中标日期'}
                ,{field: 'winfee', title: '中标价(元)'}
                ,{field: 'gongqi', title: '工期(天)'}
                ,{field: 'gongshuo', title: '工程说明'}
                ,{field: 'explain', title: '备注'}
                ,{field: 'created_user_name', title: '创建人'}
                ,{field: 'created_at', title: '创建时间'}
            ]]
            ,done : function(res, curr, count){
                $(".layui-table-tool").remove()
                soulTable.render(this);
            }
        });
        listTableSearch(form, table);


        $('#submit').on('click', function () {
            var checkStatus = layui.table.checkStatus('datalist');
            var data = checkStatus.data;
            if(data.length < 1){
                facade.error("请选择数据");return false;
            }


            var enginids = '0';
            for (var jjj in data){
                enginids += ','+data[jjj].id;
            }
            facade.ajax({url: ask_opt_get_engin_children, data:{ids:enginids}}).done(function(res){
                if (res.code === 2000) {
                    data = [];
                    data = res.data;

                    if(parent_page === 'contract_bu'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        if(data[0].shiid > 0){
                            var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].shiid+'"><span class="choose_content">'+data[0].shiname+'' +
                                '</span><span class="choose_close" onclick="choose_close(this, \'shiid\')">×</span></button>';
                            $("#shiid" , parent.document).html(str);
                            parent.formValid('shiid');

                            $("#shi_faer", parent.document).val(data[0].shifaer);
                            $("#shi_chenger", parent.document).val(data[0].shichenger_name);
                            $("#name", parent.document).val(data[0].shiname+'补充合同');
                        }else{
                            $("#shiid", parent.document).html('');
                            $("#shi_faer", parent.document).val('');
                            $("#shi_chenger", parent.document).val('');
                            $("#name", parent.document).val('');
                        }

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'stuff_ru'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).html('');
                        $("#ru_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'stuff_cai'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).html('');
                        $("#cai_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'stuff_jie'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).html('');
                        $("#jie_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'labour_shen'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).val('');
                        $("#list_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'device_jin'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).val('');
                        $("#list_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'device_jie'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).val('');
                        $("#list_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'contract_kuan'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shiid", parent.document).html('');
                        $("#shi_money", parent.document).val('');
                        $("#shi_number", parent.document).val('');
                        $("#shi_faer", parent.document).val('');
                        $("#kuan_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'labour_jie'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).val('');
                        $("#contract_money", parent.document).val('');
                        $("#list_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'subbao_shen'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).val('');
                        $("#list_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'subbao_jie'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        $("#caiid", parent.document).html('');
                        $("#gonger", parent.document).val('');
                        $("#contract_money", parent.document).val('');
                        $("#list_list", parent.document).html('');

                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else if(parent_page === 'speed_month'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);
                        $("#list_list", parent.document).html('');

                    }else if(parent_page === 'engin_speed'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#monthid", parent.document).html('');
                        $("#list_list", parent.document).html('');
                    }else if(parent_page === 'engin_chan'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#list_list", parent.document).html('');
                    }else if(parent_page === 'piao_shou'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $('#list_list tr', parent.document).each(function (i) {
                            $(this).find('.caiid').attr('caiid', 0).val('');
                        })


                    }else if(parent_page === 'contract_bian'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#caiid", parent.document).html('');
                        $("#list_list", parent.document).html('');

                        $("#caiDiv" , parent.document).attr('budgetid', data[0].budgetid);
                        if (typeof(window.parent.set_list_layout)!="undefined"){
                            window.parent.set_list_layout();
                        }
                    }else if(parent_page === 'contract_ling'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#caiDiv" , parent.document).attr('budgetid', data[0].budgetid);
                        if (typeof(window.parent.set_list_layout)!="undefined"){
                            window.parent.set_list_layout();
                        }
                    }else if(parent_page === 'cert_use'){
                        var str = '<button type="button"' +
                            'class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';

                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        var placeArr = parent.placeArr;
                        var cert_list = data[0].cert_use;
                        var cert_str = '';
                        for(var key in cert_list){
                            cert_str += '<tr>';
                            cert_str += '<td style="width: 45px;">'+(key+1)+'</td>';
                            cert_str += '<td><select class="layui-select place">';
                            str += '<option value="">请选择</option>';
                            for (var mmm in placeArr) {
                                if(cert_list[key].place == placeArr[mmm]){
                                    cert_str += '<option value="'+placeArr[mmm]+'" selected>'+placeArr[mmm]+'</option>';
                                }else{
                                    cert_str += '<option value="'+placeArr[mmm]+'">'+placeArr[mmm]+'</option>';
                                }
                            }
                            cert_str += '</select></td>';
                            cert_str += '<td><input type="text" onclick="check_cert_one(this)" certid="'+cert_list[key].certid+'" readonly value="'+cert_list[key].name+'" class="layui-input disabled name"></td>';
                            cert_str += '<td><input type="text" class="layui-input numberss disabled" readonly value="'+cert_list[key].number+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input major_name disabled" readonly value="'+cert_list[key].major_name+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input person_name disabled" readonly value="'+cert_list[key].person_name+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input statueuse_name disabled" readonly value="'+cert_list[key].statueuse_name+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input chanid_name disabled" readonly value="'+cert_list[key].chanid_name+'"></td>';

                            cert_str += '<td><select class="layui-select issuo">';
                            if(cert_list[key].issuo == '是'){
                                cert_str += '<option value="是" selected>是</option>';
                                cert_str += '<option value="否">否</option>';
                            }else{
                                cert_str += '<option value="是">是</option>';
                                cert_str += '<option value="否" selected>否</option>';
                            }
                            cert_str += '</select></td>';
                            cert_str += '<td><input type="number" class="layui-input usefee" value="'+cert_list[key].usefee+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input startdt bdate_ymd" readonly value="'+cert_list[key].startdt+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input yudt bdate_ymd"  readonly value="'+cert_list[key].yudt+'"></td>';
                            cert_str += '<td><input type="text" class="layui-input enddt bdate_ymd" readonly value="'+cert_list[key].enddt+'"></td>';

                            cert_str += '<td><select class="layui-select opt">';
                            if(cert_list[key].opt > 0){
                                cert_str += '<option value="1" selected>在用</option>';
                                cert_str += '<option value="0">停用</option>';
                            }else{
                                cert_str += '<option value="1">在用</option>';
                                cert_str += '<option value="0" selected>停用</option>';
                            }
                            cert_str += '</select></td>';
                            cert_str += '</tr>';
                        }
                        $("#list_list" , parent.document).append(cert_str);
                        parent.render_date();
                        parent.render_from();
                    }else if(parent_page === 'income_engin'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#lian_unit" , parent.document).val(data[0].lian_unit);
                        $("#shimoney" , parent.document).val(data[0].shimoney);
                        $("#huimoney" , parent.document).val(data[0].incomeenginfee);
                    }else if(parent_page === 'payment_neifu'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shimoney" , parent.document).val(data[0].shimoney);
                        $("#incomeenginfee" , parent.document).val(data[0].incomeenginfee);
                        $("#neifufee" , parent.document).val(data[0].neifufee);
                        $("#neikoufee" , parent.document).val(data[0].neikoufee);
                        $("#paymentenginfee" , parent.document).val(data[0].paymentenginfee);
                        $("#gongyufee" , parent.document).val(data[0].gongyufee);


                        var koulist = data[0].koulist;
                        var koulist_str = '';
                        if(koulist.length > 0){
                            for (var key in koulist){
                                var nums = parseInt(key)+1;
                                koulist_str += '<tr>';
                                koulist_str += '<td style="width: 45px">'+nums+'</td>';
                                koulist_str += '<td><input type="text" class="layui-input feiname disabled" disabled value="'+koulist[key].feiname_name+'"></td>';
                                koulist_str += '<td><input type="text" class="layui-input kouname disabled" disabled value="'+koulist[key].kouname+'"></td>';
                                koulist_str += '<td><input type="number" class="layui-input yingkou disabled" disabled value="'+koulist[key].yingkou+'"></td>';
                                koulist_str += '<td><input type="number" class="layui-input leikou disabled" disabled value="'+koulist[key].leikou+'"></td>';
                                koulist_str += '<td><input type="number" class="layui-input daikou disabled" disabled value="'+koulist[key].daikou+'"></td>';
                                koulist_str += '</tr>';
                            }
                        }
                        $("#list_list", parent.document).html(koulist_str);
                    }else if(parent_page === 'payment_engin'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shimoney" , parent.document).val(data[0].shimoney);
                        $("#incomeenginfee" , parent.document).val(data[0].incomeenginfee);
                        $("#neifufee" , parent.document).val(data[0].neifufee);
                        $("#neikoufee" , parent.document).val(data[0].neikoufee);
                        $("#paymentenginfee" , parent.document).val(data[0].paymentenginfee);
                        $("#gongyufee" , parent.document).val(data[0].gongyufee);

                        $("#lian_unit" , parent.document).val(data[0].lian_unit);
                        $("#lian_unit_tel" , parent.document).val(data[0].lian_unit_tel);
                        $("#allyufee" , parent.document).val(data[0].allyufee);
                        $("#lei_yubalance" , parent.document).val(data[0].lei_yubalance);
                    }else if(parent_page === 'payment_yuzhi'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shimoney" , parent.document).val(data[0].shimoney);
                        $("#lian_unit" , parent.document).val(data[0].lian_unit);
                        $("#lian_unit_tel" , parent.document).val(data[0].lian_unit_tel);
                        $("#lei_yushou" , parent.document).val(data[0].lei_yushou);
                        $("#lei_yuzhiall" , parent.document).val(data[0].lei_yuzhiall);
                        $("#lei_yubalance" , parent.document).val(data[0].lei_yubalance);
                    }else if(parent_page === 'piao_put'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shimoney" , parent.document).val(data[0].shimoney);
                        parent.initParseMoney();
                    }else if(parent_page === 'piao_kou'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shimoney" , parent.document).val(data[0].shimoney);
                        $("#xiaofee" , parent.document).val(data[0].xiaofee);
                        $("#wangmoney" , parent.document).val(data[0].leiratefee);
                        parent.initParseMoney();
                    }else if(parent_page === 'income_engin_kuan'){
                        var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#shiname" , parent.document).val(data[0].shiname);
                    }else if(parent_page === 'labour_hua'){
                        var str = '<button type="button"' +
                            'class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#business_name" , parent.document).val(data[0].business_name);
                    }else if(parent_page === 'legal'){
                        var str = '<button type="button"' +
                            'class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#xianger" , parent.document).val(data[0].man_xiang_name);
                        $("#xiangtel" , parent.document).val(data[0].man_xiang_tel);
                    }else if(parent_page === 'engin_shuinuo'){
                        var str = '<button type="button"' +
                            'class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';
                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);

                        $("#engin_number" , parent.document).val(data[0].number);
                        $("#lian_unit" , parent.document).val(data[0].lian_unit);
                        $("#lian_unit_tel" , parent.document).val(data[0].lian_unit_tel);
                    }else if(parent_page == 'hou_gonghui_one'){
                        $("#qifei_list tr", parent.document).eq(parent_domkey).find('.enginid').val(data[0].name);
                        $("#qifei_list tr", parent.document).eq(parent_domkey).find('.enginid').attr('enginid',data[0].id);
                        if (typeof(window.parent.update_refresh_row_func)!="undefined"){
                            window.parent.update_refresh_row_func();
                        }
                    }else{
                        var str = '<button type="button"' +
                            'class="layui-btn layui-btn-sm btn-dark" key="'+data[0].id+'"><span class="choose_content">'+data[0].name+'' +
                            '</span><span class="choose_close" onclick="choose_close(this, \''+parent_dom+'\')">×</span></button>';

                        $("#"+parent_dom , parent.document).html(str);
                        parent.formValid(parent_dom);


                        if(parent_page === 'kaoshi'){
                            $('#gofuer', parent.document).val(data[0].gofuer);
                            $('#gofutel', parent.document).val(data[0].gofutel);
                        }

                        if(parent_page === 'kaobao'){
                            $('#engin_gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#gofuer', parent.document).val(data[0].gofuer);
                            $('#gofutel', parent.document).val(data[0].gofutel);
                            $('#engin_gongqi', parent.document).val(data[0].gongqi);
                            if(data[0].shiinfo){
                                $('#engin_shimoney', parent.document).val(data[0].shiinfo.money);
                            }else{
                                $('#engin_shimoney', parent.document).val('');
                            }
                        }

                        if(parent_page === 'contract_nei'){
                            $('#engin_number', parent.document).val(data[0].number);
                            $('#engin_gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#gofuer', parent.document).val(data[0].gofuer);
                            $('#gofutel', parent.document).val(data[0].gofutel);
                            $('#ratefu', parent.document).val(data[0].ratefu);
                            $('#rateshui', parent.document).val(data[0].rateshui);
                        }

                        if(parent_page === 'contract_shi'){
                            $("#name" , parent.document).val(data[0].name+'施工合同');
                            $("#year" , parent.document).val(data[0].yearcur);
                            $('#gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#gongzi', parent.document).val(data[0].gongzi);
                            $('#gofuer', parent.document).val(data[0].gofuer);
                            $('#gofutel', parent.document).val(data[0].gofutel);

                            if(data[0].jiaer){
                                var str = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].jiaer+'"><span class="choose_content">'+data[0].jiaer+'' +
                                    '</span><span class="choose_close" onclick="choose_close(this, \'faer\')">×</span></button>';
                                $("#faer" , parent.document).html(str);
                                parent.formValid('shiid');
                            }



                            var chenger_str = '<div class="tags">';
                            chenger_str += '<div ' +
                                'title="'+data[0].win_unit_name+'" '+
                                'data-id="'+data[0].win_unit+'" '+
                                'data-part="dept" '+
                                '>';
                            chenger_str += data[0].win_unit_name+'</div>';
                            chenger_str += '<i class="layui-icon" onclick="closeTanTag(this)">&#x1006;</i></div>';
                            $('#chenger', parent.document).html(chenger_str);
                            parent.render_from();
                        }

                        if(parent_page === 'contract_cai'){
                            if(data[0].shiinfo){
                                if(data[0].shiinfo.chenger > 0){
                                    var kaier_str = '<div class="tags">';
                                    kaier_str += '<div ' +
                                        'title="'+data[0].shiinfo.chenger_name+'" '+
                                        'data-id="'+data[0].shiinfo.chenger+'" '+
                                        'data-part="dept" '+
                                        '>';
                                    kaier_str += data[0].shiinfo.chenger_name+'</div>';
                                    kaier_str += '<i class="layui-icon" onclick="closeTanTag(this)">&#x1006;</i></div>';
                                    $('#caier', parent.document).html(kaier_str);
                                }
                            }

                        }

                        if(parent_page === 'piao_kai'){
                            $('#engin_number', parent.document).val(data[0].number);
                            $('#engin_gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#engin_gofuer', parent.document).val(data[0].gofuer);
                            $('#engin_gofutel', parent.document).val(data[0].gofutel);
                            if(data[0].neiinfo){
                                $('#engin_neiname', parent.document).val(data[0].neiinfo.name);
                            }else{
                                $('#engin_neiname', parent.document).val('');
                            }
                            $('#engin_winfee', parent.document).val(data[0].winfee);
                            $('#engin_shijiefee', parent.document).val(data[0].shijiefee);

                            if(data[0].shangpiaokai){
                                parent.xmselect_dan('qianpiaotype', parent.pub_qianpiaotype, data[0].shangpiaokai.qianpiaotype, function (res) {
                                    if(res.arr && res.arr.length > 0){
                                        $("#qianpiaotype").find('xm-select').removeClass('error');
                                    }else{
                                        $("#qianpiaotype").find('xm-select').addClass('error');
                                    }
                                });
                                parent.xmselect_dan('shuilv', parent.pub_shuilv, data[0].shangpiaokai.shuilv, function (res) {
                                    if(res.arr && res.arr.length > 0){
                                        $("#shuilv").find('xm-select').removeClass('error');
                                    }else{
                                        $("#shuilv").find('xm-select').addClass('error');
                                    }
                                });
                                parent.xmselect_dan('kuantype', parent.pub_kuantype, data[0].shangpiaokai.kuantype, function (res) {
                                    if(res.arr && res.arr.length > 0){
                                        $("#kuantype").find('xm-select').removeClass('error');
                                    }else{
                                        $("#kuantype").find('xm-select').addClass('error');
                                    }
                                });
                                parent.xmselect_dan('funei', parent.pub_funei, data[0].shangpiaokai.funei);
                                $("#bei_gong" , parent.document).val(data[0].shangpiaokai.bei_gong);
                                $("#bei_addr" , parent.document).val(data[0].shangpiaokai.bei_addr);
                                $("#bei_yao" , parent.document).val(data[0].shangpiaokai.bei_yao);

                                if(data[0].shangpiaokai.kaier_info){
                                    parent.tan_tags_init('#kaier', data[0].shangpiaokai.kaier_info);
                                }

                                if(data[0].shangpiaokai.shouer){
                                    var shouerstr = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].shangpiaokai.shouer+'"><span class="choose_content">'+data[0].shangpiaokai.shouer+'' +
                                        '</span><span class="choose_close" onclick="choose_close(this, \'shouer\')">×</span></button>';
                                    $("#shouer" , parent.document).html(shouerstr);
                                    parent.formValid('shouer');
                                }

                                if(data[0].shangpiaokai.kai_zhangname){
                                    $("#kai_zhangname" , parent.document).html('');
                                    parent.set_choose_btn('kai_zhangname',data[0].shangpiaokai.kai_zhangname,data[0].shangpiaokai.kai_zhangname);
                                }
                                $("#kai_bankname" , parent.document).val(data[0].shangpiaokai.kai_bankname);
                                $("#kai_banknum" , parent.document).val(data[0].shangpiaokai.kai_banknum);
                                if(data[0].shangpiaokai.shouer){
                                    $("#shouer" , parent.document).html('');
                                    parent.set_choose_btn('shouer',data[0].shangpiaokai.shouer,data[0].shangpiaokai.shouer);
                                }

                                if(data[0].shangpiaokai.shouer){
                                    var shouerstr = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].shangpiaokai.shouer+'"><span class="choose_content">'+data[0].shangpiaokai.shouer+'' +
                                        '</span><span class="choose_close" onclick="choose_close(this, \'shouer\')">×</span></button>';
                                    $("#shouer" , parent.document).html(shouerstr);
                                    parent.formValid('shouer');
                                }

                                $("#ratenum" , parent.document).val(data[0].shangpiaokai.ratenum);
                                $("#bankname" , parent.document).val(data[0].shangpiaokai.bankname);
                                $("#banknum" , parent.document).val(data[0].shangpiaokai.banknum);
                                $("#unitaddr" , parent.document).val(data[0].shangpiaokai.unitaddr);
                                $("#phone" , parent.document).val(data[0].shangpiaokai.phone);
                            }else{
                                if(data[0].shiinfo){
                                    if(data[0].shiinfo.chenger){
                                        parent.tan_tags_init('#kaier', [{'id':data[0].shiinfo.chenger,'name':data[0].shiinfo.chenger_name,'part':'dept'}]);
                                    }

                                    var shouerstr = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].shiinfo.faer+'"><span class="choose_content">'+data[0].shiinfo.faer+'' +
                                        '</span><span class="choose_close" onclick="choose_close(this, \'shouer\')">×</span></button>';
                                    $("#shouer" , parent.document).html(shouerstr);
                                    parent.formValid('shouer');

                                    if(data[0].shiinfo.faerinfo){
                                        $("#ratenum" , parent.document).val(data[0].shiinfo.faerinfo.ratenum);
                                        $("#bankname" , parent.document).val(data[0].shiinfo.faerinfo.bankname);
                                        $("#banknum" , parent.document).val(data[0].shiinfo.faerinfo.banknum);
                                        $("#unitaddr" , parent.document).val(data[0].shiinfo.faerinfo.unitaddr);
                                        $("#phone" , parent.document).val(data[0].shiinfo.faerinfo.phone);
                                    }
                                }else{
                                    $("#kaier" , parent.document).val('');
                                    $("#shouer" , parent.document).val('');
                                }
                            }

                            $('#leikaifee', parent.document).val(data[0].leikaifee);
                            parent.jisuan_jiebenrate();
                        }
                        if(parent_page === 'engin_kua'){
                            $('#engin_number', parent.document).val(data[0].number);
                            $('#engin_gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#engin_gofuer', parent.document).val(data[0].gofuer);
                            $('#engin_gofutel', parent.document).val(data[0].gofutel);
                            if(data[0].neiinfo){
                                $('#engin_neiname', parent.document).val(data[0].neiinfo.name);
                            }else{
                                $('#engin_neiname', parent.document).val('');
                            }
                            $('#engin_winfee', parent.document).val(data[0].winfee);
                            $('#engin_shijiefee', parent.document).val(data[0].shijiefee);


                            if(data[0].shiinfo){
                                var shouerstr = '<button type="button" class="layui-btn layui-btn-sm btn-dark" key="'+data[0].shiinfo.faer+'"><span class="choose_content">'+data[0].shiinfo.faer+'' +
                                    '</span><span class="choose_close" onclick="choose_close(this, \'shouer\')">×</span></button>';
                                $("#shouer" , parent.document).html(shouerstr);
                                parent.formValid('shouer');

                                if(data[0].shiinfo.faerinfo){
                                    $("#ratenum" , parent.document).val(data[0].shiinfo.faerinfo.ratenum);
                                    $("#bankname" , parent.document).val(data[0].shiinfo.faerinfo.bankname);
                                    $("#banknum" , parent.document).val(data[0].shiinfo.faerinfo.banknum);
                                    $("#unitaddr" , parent.document).val(data[0].shiinfo.faerinfo.unitaddr);
                                    $("#phone" , parent.document).val(data[0].shiinfo.faerinfo.phone);
                                }
                            }else{
                                $("#shouer" , parent.document).val('');
                            }

                            $('#qianfee', parent.document).val(data[0].qianfee);
                            parent.jisuan_quanfee();
                        }
                        if(parent_page === 'hou_gongshui'){
                            $('#gofuer', parent.document).val(data[0].gofuer);
                            $('#caifee', parent.document).val(data[0].caifee);
                            $('#caijiefee', parent.document).val(data[0].caijiefee);
                            $('#piaoshoufee', parent.document).val(data[0].piaoshoufee);
                            $('#piaoshouratefee', parent.document).val(data[0].piaoshouratefee);
                            $('#piaokaifee', parent.document).val(data[0].piaokaifee);
                            $('#piaokairatefee', parent.document).val(data[0].piaokairatefee);
                            $('#yingkoushuifee', parent.document).val(data[0].yingkoushuifee);
                            $('#yikoushuifee', parent.document).val(data[0].yikoushuifee);
                            $('#daikoushuifee', parent.document).val(data[0].daikoushuifee);
                            $('#leigongshuifee', parent.document).val(data[0].leigongshuifee);
                        }
                        if(parent_page === 'kuai_ji'){
                            $('#gofuer', parent.document).val(data[0].gofuer);
                        }
                        if(parent_page === 'kuai_shou'){
                            $('#gofuer', parent.document).val(data[0].gofuer);
                        }


                        if(parent_page === 'hou_gonghui'){
                            $('#engin_number', parent.document).val(data[0].number);
                            $('#engin_gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#engin_gofuer', parent.document).val(data[0].gofuer);
                            $('#engin_gofutel', parent.document).val(data[0].gofutel);
                            if(data[0].shiinfo){
                                $('#engin_shimoney', parent.document).val(data[0].shiinfo.money);
                            }else{
                                if(data[0].winfee){
                                    $('#engin_shimoney', parent.document).val(data[0].winfee);
                                }
                            }
                            $('#engin_shijiefee', parent.document).val(data[0].shijiefee);
                            if(data[0].neiinfo){
                                $('#engin_neiname', parent.document).val(data[0].neiinfo.name);
                            }

                            $('#engin_piaokaifee', parent.document).val(data[0].piaokaifee);
                            $('#engin_leixiaobi', parent.document).val(data[0].leixiaobi);

                            $('#engin_hougonghuimoney', parent.document).val(data[0].hougonghuimoney);
                            $('#engin_leihuibi', parent.document).val(data[0].leihuibi);
                            $('#engin_hougongzhimoneyquben', parent.document).val(data[0].hougongzhimoneyquben);
                            $('#engin_hougonghuikoufee', parent.document).val(data[0].hougonghuikoufee);
                            $('#engin_jiedongkoufee', parent.document).val(data[0].jiedongkoufee);
                            $('#engin_gonghui_keyu', parent.document).val(data[0].gonghui_keyu);
                        }


                        if(parent_page === 'hou_gongzhi'){
                            $('#engin_number', parent.document).val(data[0].number);
                            $('#engin_gui_unit_name', parent.document).val(data[0].gui_unit_name);
                            $('#engin_gofuer', parent.document).val(data[0].gofuer);
                            $('#engin_gofutel', parent.document).val(data[0].gofutel);
                            if(data[0].neiinfo){
                                $('#engin_neiname', parent.document).val(data[0].neiinfo.name);
                            }
                            if(data[0].shiinfo){
                                $('#engin_shimoney', parent.document).val(data[0].shiinfo.money);
                            }else{
                                if(data[0].winfee){
                                    $('#engin_shimoney', parent.document).val(data[0].winfee);
                                }
                            }
                            $('#engin_shijiefee', parent.document).val(data[0].shijiefee);

                            $('#engin_hougonghuimoney', parent.document).val(data[0].hougonghuimoney);
                            $('#engin_leihuibi', parent.document).val(data[0].leihuibi);
                            $('#engin_hougongzhimoneyquben', parent.document).val(data[0].hougongzhimoneyquben);
                            $('#engin_hougonghuikoufee', parent.document).val(data[0].hougonghuikoufee);
                            $('#engin_jiedongkoufee', parent.document).val(data[0].jiedongkoufee);
                            $('#engin_gonghui_keyu', parent.document).val(data[0].gonghui_keyu);


                            //处理收取信息
                            var last_kou_list = data[0].last_kou_list;
                            var kou_str = '';
                            for(var ppp in last_kou_list){
                                kou_str += '<tr>';
                                kou_str += '<td style="width: 45px;">'+(parseInt(ppp)+1)+'</td>';
                                kou_str += '<td><input type="text" class="layui-input name disabled" readonly value="'+last_kou_list[ppp].name+'"></td>';
                                kou_str += '<td><input type="text" class="layui-input enginname disabled" readonly value="'+last_kou_list[ppp].enginname+'"></td>';
                                kou_str += '<td><input type="number" class="layui-input koufee disabled" readonly value="'+last_kou_list[ppp].koufee+'"></td>';
                                kou_str += '<td style="padding: 0 10px!important;"><span>'+last_kou_list[ppp].shoubiao+'</span></td>';
                                kou_str += '<td style="padding: 0 10px!important;"><span>'+last_kou_list[ppp].explain+'</span></td>';
                                // kou_str += '<td><input type="text" class="layui-input shoubiao disabled" readonly value="'+last_kou_list[ppp].shoubiao+'"></td>';
                                // kou_str += '<td><input type="text" class="layui-input explain disabled" readonly value="'+last_kou_list[ppp].explain+'"></td>';
                                kou_str += '</tr>';
                            }
                            $("#list_kou" , parent.document).html(kou_str);

                        }

                    }


                    layer_close();
                }
            });



        });

    });
</script>
</body>
</html>
